<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %><%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2024-04-24
  Time: 13:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%!
    public String codeToString(String str)
    {//处理中文字符串的函数
        String s=str;
        try
        {
            byte tempB[]=s.getBytes("ISO-8859-1");
            s=new String(tempB);
            return s;
        }
        catch(Exception e)
        {
            return s;
        }
    }
%>
<html>
<head>
    <title>Title</title>
    <meta http-equiv="refresh" content="5">
    <style>
        .online-users {
            text-align: right;
            font-size: 18px;
        }
    </style>
</head>
<body>
    <div class="online-users">
        在线用户: <%= (Integer)application.getAttribute("user_online") %>
    </div>
    <%
    // 示例用户列表，实际中可从后端获取
    List<String> userList = (List<String>) application.getAttribute("user_list");
    for (String s : userList) {
    %>
    <li><%=codeToString(s)%></li>
    <%
        }
    %>
</body>
</html>
